<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>病人缴费</title>
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/default/easyui.css"/>">
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/icon.css"/>">
	
	<script type="text/javascript" src="<c:url value="/js/jquery.min.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/js/jquery.easyui.min.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/js/easyui-lang-zh_CN.js"/>"></script>
</head>
<body>
	<script type="text/javascript">
		$(function(){
			//退费
			$("#jf").linkbutton({onClick:function(){
				var rows = $("#tb-brjf").datagrid("getSelections");
				if(rows.length == 1){
					$("#his_jfjr").window("open");

					$("#tjjfje").linkbutton({onClick:function(){
						var brno = rows[0].brNo;
						var jfje = document.getElementById("jfje").value;

						$.getJSON("brzyjf", {"brno":brno,"jfje":jfje}, function(data){
							$.messager.alert("提示", data.reason);
						});
						$("#his_jfjr").window("close");
						$("#tb-brjf").datagrid("reload");
						$("#jfje").textbox("clear");
						

					}});
				}
				else{
					$.messager.alert("提示", "只能选择一条记录，您目前选择了" + rows.length + "条!");
				}
			}});
			
			
			
		});
	</script>


	<table id="tb-brjf" class="easyui-datagrid" 
		data-options="url:'selectzybrall',
			fitColumns:true,fit:true,
			pagination: true,
			pageSize: 5,
			pageList: [5, 10, 15, 20],
			rownumbers: true,
			singleSelect:true,
			
			toolbar: '#brjfgjl'
			">
		<thead>
			<tr>
				<th data-options="field:'brNo',width:'3%', checkbox: true">病人号</th>
				<th data-options="field:'brName', align:'center', width:'15%'">病人姓名</th>
				<th data-options="field:'ylkNo', align:'center', width:'15%'">医疗卡号</th>
				<th data-options="field:'brMoney',align:'center',width:'15%'">已交费用</th>
				<th data-options="field:'zyf',align:'center',width:'5%'">已用费用</th>
				<th data-options="field:'ye',align:'center',width:'5%'">余额</th>
				<th data-options="field:'brSituation', align:'center',width:'15%'">病人情况</th>
				<th data-options="field:'ksmc',align:'center',width:'15%'">科室</th>
				<th data-options="field:'bqNo',align:'center',width:'5%'">科室号</th>
			</tr>
		</thead>
	</table>
	
		<!--工具栏-->
	<div id="brjfgjl">
		<a  id="xsbrjf" class="easyui-linkbutton" data-options="iconCls:'icon-xsqb',plain:true">显示全部</a>
		<a  id="ckbrjf" class="easyui-linkbutton" data-options="iconCls:'icon-ck',plain:true">查看病人信息</a>
		<a  id="jf" class="easyui-linkbutton" data-options="iconCls:'icon-bc',plain:true">缴费</a>
		
		
		
		
		<input  id="zyjf-so" class="easyui-searchbox" data-options="prompt:'请输入',menu:'#zyjf',searcher:doSearch" style="width:300px"></input>

		<div id="zyjf" >
		<div data-options="name:'xm'">姓名</div>
		<div data-options="name:'ylkNo'">医疗卡号</div>
	</div>
	</div>
	
		<script>
		var url ;
		$(function(){
			doSearch();
			$("#zyjf").menu({
				onClick:function(itme){
					url =	(itme.name == 'xm' ? '' : '');	
					
				}
			});
		})
		function doSearch(value,name){
			$('#zyjf-so').searchbox({
			    searcher:function(value,name){
			    	$("#tb-brjf").datagrid({
			    		url:url, 
			    		method: 'post', 
			    		queryParams: {
			    			ss: value
			    		}});
			    }
			});
			
		}
	</script>
		<div id="his_jfjr" class="easyui-window" title="住院患者缴费"
		data-options="collapsible:false,minimizable:false,maximizable:false,modal:true,iconCls:'icon-xx',closed: true"
		style="width: 230px; height: 110px; padding: 5px;">

		<div>
				<input name="" id="jfje"  class="easyui-textbox" data-options="label: '缴费金额：', width: 200">
		</div>

		<div style="margin-top:5px;margin-right:5px;">
			<a  id="tjjfje" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" style="float:right" >确定</a>
		</div>

	</div>
	
</body>
</html>